<!DOCTYPE html>
<html  class="iframe-h">
<head>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>后台管理</title>
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/layui/css/layui.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/admin.css"/>
</head>
<body>
<div class="page-content-wrap">

  
  <form class="layui-form" action="">
    <div class="layui-form-item">
      <div class="layui-inline">批次号：</div>
      <div class="layui-inline">
        <input type="text" name="q" placeholder="批次号" autocomplete="off" class="layui-input">
      </div>
      <div class="layui-inline">状态：</div>
      <div class="layui-inline">
        <select name="status" lay-filter="status">
          <option value="">请选择状态</option>
          {volist name='_starr' id='vo'}
          <option value="{$key}">{$vo}</option>
          {/volist}
        </select>
      </div>
      <div class="layui-inline">开始日期：</div>
      <div class="layui-inline">
         <input type="text" name="begin" placeholder="请选择日期" readonly autocomplete="off" class="layui-input date_input">
      </div>
      <div class="layui-inline">结束日期：</div>
      <div class="layui-inline">
         <input type="text" name="end" placeholder="请选择日期" readonly autocomplete="off" class="layui-input date_input">
      </div>
      <button class="layui-btn layui-btn-normal" type="submit" lay-submit="search">搜索</button>
    </div>
  </form>
  
  
  <div class="layui-form">
    <form action="{:url()}" method="post" class="list_form confirm">
    <table class="layui-table" lay-even lay-skin="nob">
      <colgroup>
      <col class="hidden-xs" width="120">
      <col class="hidden-xs" width="120">
      <col class="hidden-xs" width="120">
      <col width="120">
      <col width="120">
      <col width="120">
      <col width="150">
      <col class="hidden-xs" width="150">
      <col width="180">
      </colgroup>
      <thead>
        <tr>
          <th class="hidden-xs">批次号</th>
          <th class="hidden-xs">提单类型</th>
          <th class="hidden-xs">提单人</th>
          <th>代理</th>
          <th>应收金额（元）</th>
          <th>实收金额（元）</th>
          <th>状态（原图）</th>
          <th class="hidden-xs">提单时间</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
        
        {volist name='_list' id='vo'}
        <tr>
          <td class="hidden-xs">{$vo.order_no}</td>
          <td class="hidden-xs">{$vo.type_text}</td>
          <td class="hidden-xs">{$vo.mid|get_member_field}</td>
          <td>{$vo.aid|get_member_field='name'}</td>
          <td>{$vo.receivable}</td>
          <td>{$vo.receipts}</td>
          <td>{$vo.status_text}{if condition="$vo['status'] eq 2"}（{$vo.remark}）{/if}</td>
          <td class="hidden-xs">{$vo.ctime|time_format}</td>
          <td>
          <div class="layui-inline">
			{if condition="chk_btn_auth(135,$_rules)"}
            <a href="javascript:;" data-url="{:url('view',['id'=>$vo['id']])}" class="view_link" style="color:#1E9FFF;">查看</a>
            {/if}
            {if condition="chk_btn_auth(134,$_rules) && $vo['status'] eq 0"}
            <span  class="hidden-xs">|</span> 
            <a href="javascript:;" data-url="{:url('status',['id'=>$vo['id'],'st'=>1])}" class="go_btn" style="color:#090">通过</a> <span  class="hidden-xs">|</span>  
			<a href="javascript:;" data-url="{:url('status',['id'=>$vo['id'],'st'=>2])}" class="bak_btn" style="color:#F00">拒绝</a>
            {/if}
			</div>
          </td>
        </tr>
        {/volist}
        
        
      </tbody>
    </table>
    </form>
    <div class="page-wrap">
      {$_page}
      </div>
  </div>
</div>
<script src="__STATIC__/js/jquery.min.js" type="text/javascript" charset="utf-8"></script> 
<script src="__STATIC__/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script> 
<script src="__STATIC__/js/common.js" type="text/javascript" charset="utf-8"></script> 
<script>
		layui.use(['form', 'jquery', 'layer', 'laydate'], function() {
				var form = layui.form(),
					layer = layui.layer,
					laydate = layui.laydate,
					$ = layui.jquery;
					
				//获取当前iframe的name值
				var iframeObj = $(window.frameElement).attr('name');	
				
				
				$('.date_input').on('click',function(){
					var obj = $(this)[0];
					laydate({
						elem: obj
					});	
				});
				
				  
				form.on('checkbox(emailAllChoose)', function(data) {
					var child = $(data.elem).parents('table').find('tbody input[type="checkbox"]');
					child.each(function(index, item) {
						item.checked = data.elem.checked;
					});
					form.render('checkbox');
				});
				
				$('.go_btn').on('click',function(){
					var title = '<span style="color:#F00">请认真确认是否收到订单款！</span>';
					var url=$(this).attr('data-url');
					var agbox = layer.confirm(title, {
								title:'提示信息',
								btn: ['确定','取消'] //按钮
					}, function(){
						get_data(url,true);
						layer.close(agbox);
					}, function(){
						layer.close(agbox);
					});
					return false;
				})
				
				$('.bak_btn').on('click',function(){
					var url=$(this).attr('data-url');
					
					layer.prompt({title: '请填写拒绝的原因，并确认', formType: 2}, function(text, index){
						layer.close(index);
						url = conv_url(url)+'remark='+text;
						get_data(url,true);
					});
					
					return false;
				})

				//查看内容
				$('.view_link').on('click',function(){
					var url=$(this).attr('data-url');
					parent.parent.page("查看详细", url, iframeObj, w = "700px", h = "600px");
					return false;
				})
				
				//查看内容
				$('.sh_link').on('click',function(){
					var url=$(this).attr('data-url');
					parent.parent.page("审核订单", url, iframeObj, w = "700px", h = "400px");
					return false;
				})
				
		
				form.render();
				//非手机端，设置高度
				if(window.innerWidth>=768){
					$('.email-content').css('height',window.innerHeight-30);
				}
				$(window).resize(function(){
					$('.email-content').css('height',window.innerHeight-30);
				})
				
				
			});
	</script>

</body>
</html>